#!/bin/sh
WAP_INFO_FELE="/mnt/nand1-2/update/Software.info"
UPDATE_HTTP_ADDR=`awk '{if ($1=="HTTP_ADDR") {print $2}}' $WAP_INFO_FELE`
if [ -f ./et700update.zip ];then	
  echo "delete old et700update.zip..."
  rm ./et700update.zip   
  rm -rf UpdateFile
fi
/mnt/nand1-1/bin/curl -o et700update.zip "$UPDATE_HTTP_ADDR" --speed-time 5 --speed-limit 1
if [ -f ./et700update.zip ];then	
  if [ ! -f "/mnt/nand1-2/update/et700update.zip" ];then
    chmod 777 /mnt/nand1-2/update/et700update.zip	
  fi
  /mnt/nand1-1/bin/unzip -o ./et700update.zip		
  if [ -d UpdateFile ];then
    cd UpdateFile
    if [ ! -f "/mnt/nand1-2/update/UpdateFile/update.sh" ];then
      chmod 777 /mnt/nand1-2/update/UpdateFile/update.sh
    fi
    ./update.sh
 else		
  echo "get et700update.zip is error data
"	
 fi
else	
  echo "get et700update.zip file fail !!!"	
  exit 1
fi
exit 0
